import React, {  useEffect,useState } from 'react';
import { Column } from '@ant-design/plots';

const Test = (Props) => {
    const [viewsdata01,setViewsdata01] = useState([{'input_id':1,"count":0}])
    
    useEffect(() => {
        // console.log('--',Props.Props)
        setViewsdata01(Props.Props)
    }, [Props]);
    const views_config = {
        data: viewsdata01,
          xField: 'input_id',
          yField: 'count',
          title: '库存小于 0 ',
          tooltip: {
            title: (d) => ('ID：' + d.input_id + '- 品名：'+ d.name),
          },
        //   label: {
        //     text: (d) => `${(d.frequency * 100).toFixed(1)}%`,
        //     textBaseline: 'bottom',
        //   },
        //   axis: {
        //     y: {
        //       labelFormatter: '.0%',
        //     },
        //   },
          style: {
            // 圆角样式
            radiusTopLeft: 10,
            radiusTopRight: 10,
          },
    };
    return (
        <>
        <Column {...views_config} />
        </>

    );
};

export default Test;